.class public Lcom/wqmobile/sdk/pojoxml/core/processor/XmlToPojo;
.super Ljava/lang/Object;


# instance fields
.field private clas:Ljava/lang/Class;


# direct methods
.method public constructor <init>(Ljava/lang/Class;)V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/XmlToPojo;->clas:Ljava/lang/Class;

    return-void
.end method


# virtual methods
.method public getClas()Ljava/lang/Class;
    .locals 1

    iget-object v0, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/XmlToPojo;->clas:Ljava/lang/Class;

    return-object v0
.end method

.method public parseXMLFromFile(Ljava/lang/String;Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;)Ljava/lang/Object;
    .locals 4

    const/4 v1, 0x1

    invoke-static {}, Ljavax/xml/parsers/DocumentBuilderFactory;->newInstance()Ljavax/xml/parsers/DocumentBuilderFactory;

    move-result-object v0

    invoke-virtual {v0, v1}, Ljavax/xml/parsers/DocumentBuilderFactory;->setCoalescing(Z)V

    invoke-virtual {v0, v1}, Ljavax/xml/parsers/DocumentBuilderFactory;->setIgnoringComments(Z)V

    invoke-virtual {v0, v1}, Ljavax/xml/parsers/DocumentBuilderFactory;->setIgnoringElementContentWhitespace(Z)V

    invoke-virtual {v0, v1}, Ljavax/xml/parsers/DocumentBuilderFactory;->setNamespaceAware(Z)V

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Ljavax/xml/parsers/DocumentBuilderFactory;->setValidating(Z)V

    :try_start_0
    invoke-virtual {v0}, Ljavax/xml/parsers/DocumentBuilderFactory;->newDocumentBuilder()Ljavax/xml/parsers/DocumentBuilder;
    :try_end_0
    .catch Ljavax/xml/parsers/ParserConfigurationException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    :try_start_1
    new-instance v1, Ljava/io/File;

    invoke-direct {v1, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, v1}, Ljavax/xml/parsers/DocumentBuilder;->parse(Ljava/io/File;)Lorg/w3c/dom/Document;
    :try_end_1
    .catch Lorg/xml/sax/SAXException; {:try_start_1 .. :try_end_1} :catch_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_2

    move-result-object v0

    invoke-interface {v0}, Lorg/w3c/dom/Document;->getDocumentElement()Lorg/w3c/dom/Element;

    move-result-object v0

    invoke-virtual {p2, v0}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;->setRootNode(Lorg/w3c/dom/Node;)V

    new-instance v0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToObjectProcessor;

    iget-object v1, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/XmlToPojo;->clas:Ljava/lang/Class;

    invoke-direct {v0, v1, p2}, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToObjectProcessor;-><init>(Ljava/lang/Class;Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;)V

    invoke-virtual {v0}, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToObjectProcessor;->getParsedObject()Ljava/lang/Object;

    move-result-object v0

    return-object v0

    :catch_0
    move-exception v0

    new-instance v1, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "Configuration issue : "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v1, v0}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;-><init>(Ljava/lang/String;)V

    throw v1

    :catch_1
    move-exception v0

    new-instance v1, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "Parser Initialization issue : "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v1, v0}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;-><init>(Ljava/lang/String;)V

    throw v1

    :catch_2
    move-exception v0

    new-instance v1, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "Parser Initialization issue : "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v1, v0}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;-><init>(Ljava/lang/String;)V

    throw v1
.end method

.method public parseXMLFromInputStream(Ljava/io/InputStream;Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;)Ljava/lang/Object;
    .locals 4

    const/4 v1, 0x1

    invoke-static {}, Ljavax/xml/parsers/DocumentBuilderFactory;->newInstance()Ljavax/xml/parsers/DocumentBuilderFactory;

    move-result-object v0

    invoke-virtual {v0, v1}, Ljavax/xml/parsers/DocumentBuilderFactory;->setCoalescing(Z)V

    invoke-virtual {v0, v1}, Ljavax/xml/parsers/DocumentBuilderFactory;->setIgnoringComments(Z)V

    invoke-virtual {v0, v1}, Ljavax/xml/parsers/DocumentBuilderFactory;->setIgnoringElementContentWhitespace(Z)V

    invoke-virtual {v0, v1}, Ljavax/xml/parsers/DocumentBuilderFactory;->setNamespaceAware(Z)V

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Ljavax/xml/parsers/DocumentBuilderFactory;->setValidating(Z)V

    :try_start_0
    invoke-virtual {v0}, Ljavax/xml/parsers/DocumentBuilderFactory;->newDocumentBuilder()Ljavax/xml/parsers/DocumentBuilder;
    :try_end_0
    .catch Ljavax/xml/parsers/ParserConfigurationException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    :try_start_1
    new-instance v1, Lorg/xml/sax/InputSource;

    invoke-direct {v1, p1}, Lorg/xml/sax/InputSource;-><init>(Ljava/io/InputStream;)V

    invoke-virtual {v0, v1}, Ljavax/xml/parsers/DocumentBuilder;->parse(Lorg/xml/sax/InputSource;)Lorg/w3c/dom/Document;
    :try_end_1
    .catch Lorg/xml/sax/SAXException; {:try_start_1 .. :try_end_1} :catch_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_2

    move-result-object v0

    invoke-interface {v0}, Lorg/w3c/dom/Document;->getDocumentElement()Lorg/w3c/dom/Element;

    move-result-object v0

    invoke-virtual {p2, v0}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;->setRootNode(Lorg/w3c/dom/Node;)V

    new-instance v0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToObjectProcessor;

    iget-object v1, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/XmlToPojo;->clas:Ljava/lang/Class;

    invoke-direct {v0, v1, p2}, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToObjectProcessor;-><init>(Ljava/lang/Class;Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;)V

    invoke-virtual {v0}, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToObjectProcessor;->getParsedObject()Ljava/lang/Object;

    move-result-object v0

    return-object v0

    :catch_0
    move-exception v0

    new-instance v1, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "Configuration issue : "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v1, v0}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;-><init>(Ljava/lang/String;)V

    throw v1

    :catch_1
    move-exception v0

    new-instance v1, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "Parser Initialization issue : "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v1, v0}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;-><init>(Ljava/lang/String;)V

    throw v1

    :catch_2
    move-exception v0

    new-instance v1, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "Parser Initialization issue : "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v1, v0}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;-><init>(Ljava/lang/String;)V

    throw v1
.end method

.method public parseXMLFromXmlData(Ljava/lang/String;Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;)Ljava/lang/Object;
    .locals 4

    const/4 v2, 0x0

    const/4 v1, 0x1

    invoke-static {}, Ljavax/xml/parsers/DocumentBuilderFactory;->newInstance()Ljavax/xml/parsers/DocumentBuilderFactory;

    move-result-object v0

    invoke-virtual {v0, v2}, Ljavax/xml/parsers/DocumentBuilderFactory;->setCoalescing(Z)V

    invoke-virtual {v0, v1}, Ljavax/xml/parsers/DocumentBuilderFactory;->setIgnoringComments(Z)V

    invoke-virtual {v0, v1}, Ljavax/xml/parsers/DocumentBuilderFactory;->setIgnoringElementContentWhitespace(Z)V

    invoke-virtual {v0, v1}, Ljavax/xml/parsers/DocumentBuilderFactory;->setNamespaceAware(Z)V

    invoke-virtual {v0, v2}, Ljavax/xml/parsers/DocumentBuilderFactory;->setValidating(Z)V

    :try_start_0
    invoke-virtual {v0}, Ljavax/xml/parsers/DocumentBuilderFactory;->newDocumentBuilder()Ljavax/xml/parsers/DocumentBuilder;
    :try_end_0
    .catch Ljavax/xml/parsers/ParserConfigurationException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    :try_start_1
    new-instance v1, Ljava/io/ByteArrayInputStream;

    invoke-virtual {p1}, Ljava/lang/String;->getBytes()[B

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/io/ByteArrayInputStream;-><init>([B)V

    invoke-virtual {v0, v1}, Ljavax/xml/parsers/DocumentBuilder;->parse(Ljava/io/InputStream;)Lorg/w3c/dom/Document;
    :try_end_1
    .catch Lorg/xml/sax/SAXException; {:try_start_1 .. :try_end_1} :catch_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_2

    move-result-object v0

    invoke-interface {v0}, Lorg/w3c/dom/Document;->getDocumentElement()Lorg/w3c/dom/Element;

    move-result-object v0

    invoke-virtual {p2, v0}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;->setRootNode(Lorg/w3c/dom/Node;)V

    new-instance v0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToObjectProcessor;

    iget-object v1, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/XmlToPojo;->clas:Ljava/lang/Class;

    invoke-direct {v0, v1, p2}, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToObjectProcessor;-><init>(Ljava/lang/Class;Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;)V

    invoke-virtual {v0}, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToObjectProcessor;->getParsedObject()Ljava/lang/Object;

    move-result-object v0

    return-object v0

    :catch_0
    move-exception v0

    new-instance v1, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "Configuration issue : "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v1, v0}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;-><init>(Ljava/lang/String;)V

    throw v1

    :catch_1
    move-exception v0

    new-instance v1, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "Parser Initialization issue : "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v1, v0}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;-><init>(Ljava/lang/String;)V

    throw v1

    :catch_2
    move-exception v0

    new-instance v1, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "Parser Initialization issue : "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v1, v0}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;-><init>(Ljava/lang/String;)V

    throw v1
.end method

.method public setClas(Ljava/lang/Class;)V
    .locals 0

    iput-object p1, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/XmlToPojo;->clas:Ljava/lang/Class;

    return-void
.end method
